home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
3_9.lha
/
3_9
/
3_9a.c
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
472b
|
20 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ concatenate the two strings s1 and s2 into
/ a new string allocated on the free store
include <string.h>
har *cat(const char *s1, const char *s2)
if (!s1 || !s2)
return 0;
int length1 = strlen(s1);
char *ret = new char [ length1 + strlen(s2) + 1 ];
strcpy(ret, s1);
strcpy(ret + length1, s2);
return ret;